package net.wanho.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * Author：汤小洋
 * Date：2023-08-14 15:07
 * Description：<描述>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult implements Serializable {
    private Integer status; // 状态码
    private String msg; // 提示信息
    private Object data; // 响应数据

    public static AjaxResult success(){
        return new AjaxResult(200,"success",null);
    }

    public static AjaxResult success(Object data){
        return new AjaxResult(200,"success",data);
    }

    public static AjaxResult success(String msg, Object data){
        return new AjaxResult(200,msg,data);
    }

    public static AjaxResult success(Integer status, String msg, Object data){
        return new AjaxResult(status,msg,data);
    }

    public static AjaxResult error(String msg){
        return new AjaxResult(500,msg,null);
    }

    public static AjaxResult error(Integer status, String msg){
        return new AjaxResult(status,msg,null);
    }
}
